﻿using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using wenzhen.Models;

namespace wenzhen.Data // 确认命名空间是否与项目结构一致
{
    public class ApplicationDbContext : DbContext
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) {
            try
            {
                Database.CanConnect();
                Console.WriteLine("Database connection established successfully.");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Database connection failed: {ex.Message}");
            }
        }

        public DbSet<PatientInfos> PatientInfos { get; set; }
        public DbSet<Diagnosis> Diagnosis { get; set; }
        public DbSet<PulseDiagnosis> PulseDiagnoses { get; set; }
    }


}
